package com.threeti.mecool.core.domain.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.threeti.jiayusms.framework.domain.support.DefaultDomainEntity;
import com.threeti.mecool.core.domain.model.project.Project;
import com.threeti.mecool.core.domain.model.project.ProjectStore;

/** 沟通 */
@Entity
@Table(name = "DM_COMMUNICATION")
public class Communication extends DefaultDomainEntity {
  
  @ManyToOne
  @JoinColumn(name="PROJECT_ID")
	private Project project;
  
  @ManyToOne
  @JoinColumn(name="PROJECT_STORE_ID")
	private ProjectStore projectStore;
  
  private String title;
  private String type;
  private String contactName;
  private String contactPosition;
  private String contactPhoneOrOther;
  private String content;
  
  private Date recordDate = new Date();

  public Communication(Project project, ProjectStore projectStore, String title, String contactName, String content) {
    super();
    this.project = project;
    this.projectStore = projectStore;
    this.title = title;
    this.contactName = contactName;
    this.content = content;
  }

  /** 所在项目 */
  public Project getProject() {
    return project;
  }

  /** 所关联的(项目下的)终端门店 */
  public ProjectStore getProjectStore() {
    return projectStore;
  }

  /** 标题 */
  public String getTitle() {
    return title;
  }

  /** 沟通方式 */
  public String getType() {
    return type;
  }

  /** 联系人姓名 */
  public String getContactName() {
    return contactName;
  }

  /** 联系人职位 */
  public String getContactPosition() {
    return contactPosition;
  }

  /** 联系方式(最可能是电话) */
  public String getContactPhoneOrOther() {
    return contactPhoneOrOther;
  }

  /** 沟通内容 */
  public String getContent() {
    return content;
  }

  public Date getRecordDate() {
    return recordDate;
  }

  @Override
  public String toString() {
    return "Communication [title=" + title + ", type=" + type + ", contactName=" + contactName + ", contactPosition=" + contactPosition
        + ", contactPhoneOrOther=" + contactPhoneOrOther + ", content=" + content + ", recordDate=" + recordDate + "]";
  }

  Communication() {
    super();
  }
  
}
